#include <stdio.h>
#include <stdlib.h>

#define BUFFSIZE (1024)

void usage(void) { printf("Usage:...\n"); }

int main(int argc, char **argv) {
    if(argc != 2){ fprintf(stderr, "argc != 2\n"); usage(); exit(1); }

    FILE *fps = fopen(argv[1], "r");
    if(fps == NULL){ perror("fopen()"); exit(1); }

    int n = 0, count = 0;
    while(1){
        n = fgetc(fps); // 读取1个字符
        if(n == EOF){ break; }
        count++;  // 统计文件大小
        /*
        n = fread(buff, 1, 1024, fps);
        fwrite(buff, 1, n, fpd);
        */
    }

    printf("count=%d\n",count);
    fclose(fps);
    exit(0);
}
